using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Security.Claims; // Add this import for ClaimsPrincipal
using System.Threading.Tasks;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;

namespace RiceShop.Models
{
    /// <summary>
    /// 管理员登录请求模型
    /// </summary>
    public class LoginModel
    {
        /// <summary>
        /// 管理员名
        /// </summary>
        [Required(ErrorMessage = "管理员名不能为空")]
        public string AdminName { get; set; } = string.Empty;

        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        public string Password { get; set; } = string.Empty;
    }

    /// <summary>
    /// 角色分配请求模型
    /// </summary>
    public class AssignRoleModel
    {
        /// <summary>
        /// 管理员ID
        /// </summary>
        [Required(ErrorMessage = "管理员ID不能为空")]
        public long AdminId { get; set; }

        /// <summary>
        /// 角色ID数组
        /// </summary>        
        public long[] Roles { get; set; } = [];
    }

    /// <summary>
    ///  角色分配菜单请求模型
    /// </summary>
    public class AssignRoleMenuModel
    {
        /// <summary>
        /// 角色ID
        /// </summary>
        [Required(ErrorMessage = "角色ID不能为空")]
        public long RoleId { get; set; }

        /// <summary>
        ///  菜单ID数组
        /// </summary>        
        public long[] Menus { get; set; } = [];
    }
}
